-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix arithmetic #560
Fix arithmetic #560
Conversation
ce0c680
to
5633e01
Compare
@tmilnthorp Waiting for a review on this, then we release a new beta nuget. |
Sorry, traveling the past few days. I'll review this tomorrow. There's a couple things I want to compare to. |
[Theory] | ||
[InlineData(TemperatureUnit.DegreeCelsius, 30, 20, "-263.15 °C")] | ||
[InlineData(TemperatureUnit.DegreeCelsius, 30, 30, "-273.15 °C")] | ||
[InlineData(TemperatureUnit.DegreeFahrenheit, 100, 70, "-429.67 °F")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an engineering standpoint, I agree 100%. But at what point do you switch from a general use library to an engineering/science specific library? I would expect 30C - 20C = 10C for "general" use. If I was using for engineering purpose I'd convert 30/20C to K before doing the subtraction anyways. |
A lot of discussion and arguments back and forth were made in #518. Problem definition:
My conclusion: I'm open to be convinced otherwise, but we need to settle on this. Worst case pull the change out of v4 and think more on it. What do you think @tmilnthorp ? Update:
I agree, that was my perception too up until #518. One can also argue that 100F - 70F is simply converting to .DegreesFahrenheit before subtracting. Just as easy. It IS easy, just confusing. |
I did not get the look at that much, sorry it's been a bit hectic here. In any case, I think leaving it as-is gives more flexibility. The average user can still do 30C-20C=10C. I can convert to K for engineering/scientific purposes and do it that way also. I think a broad-use library is just as important as scientific correctness, so why choose? |
I think you are missing my point. I believe we are all biased, we all have our own expectations of what Temperature1 - Temperature2 should yield. A delta or a new temperature? However, I recognize that adding a special case for Temperature is more complex than treating all quantities alike. That is the reason I favor the new behavior. I can agree with the argument that before changing the behavior we must first justify it by measuring the expectations in a representative set of our userbase. I propose just that, let's revert the change back, close this fix and revisit when we know that a change will indeed improve things. It's pretty clear to me we are not able to fully agree on this just now, and then we shouldn't change anything either. |
This reverts commit b0361ba. Per discussion in: #560 (comment) We can't justify this change just yet, we need to know if the majority of our userbase expects this new Temperature arithmetic or the old one.
As part of creating the 4.x upgrade guide and testing out v4 binary I realized that Temperature arithmetic was wrong after changing to the standard arithmetic implementation.